<template>
	<div id="manageForum">
		<h2 class="text-info">版块管理</h2>
		<div v-for="forum in forums" :key="forum.id">
			<div class="card cardSize fl">
				<div class="card-body">
					<div class="card-title">版块：
						<router-link :to="{path:'/main/queryPost',query:{id:forum.id,flag:true}}">{{forum.forumName}}&nbsp;></router-link>
					</div>
					<p class="card-text">描述：{{forum.forumContent}}</p>
				</div>
			</div>

		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				forums: {

				}
			}
		},created() {
			this.userId = this.$store.state.user[0].id;
			this.getForum();
		},
		methods: {
			getForum(){
				this.$http.get('/api/getForum', {
				params: {
					id: this.userId
				}
			}).then(data => {
				if(data.status == 200) {
					this.forums = data.body;
					
				}
			},err=>{
				console.log(err)
			})
			}
		}
	}
</script>

<style scoped >
#manageForum{
	width: 500px;
	margin:0 auto;
}
</style>